import java.util.Scanner;

/**
 *
 * 输入一个正整数，按照从小到大的顺序输出它的所有质数的因子（如180的质数因子为2 2 3 3 5 ）
 *
 * 最后一个数后面也要有空格
 *
 *
 * @author: YuanChilde
 * @date: 2020-02-17 8:01
 * @version: 1.0
 * Modification History:
 * Date    Author      Version     Description
 * -----------------------------------------------------------------
 * 2020-02-17 8:01    YuanChilde     1.0        新增
 */
public class Demo8 {

    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        long num = sc.nextLong();
        String result = getResult(num);
        System.out.println(result);
    }

    public static String getResult(long ulDataInput){
        long num = ulDataInput;
        StringBuilder stringBuilder = new StringBuilder();
        int p = 2;
        while(num != 1){
            while(num%p == 0){
                num = num/p;
                stringBuilder.append(p).append(" ");
            }
            p++;
        }
        return stringBuilder.toString();
    }
}
